IOMMU: generalize and correct softirq processing during Dom0 device setup
authorJan Beulich <jbeulich@suse.com>
Tue, 4 Mar 2014 09:52:20 +0000 (10:52 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 4 Mar 2014 09:52:20 +0000 (10:52 +0100)
commit9ef5aa944a6a0df7f5938983043c7e46f158bbc6
tree9894526b3cb65078983ae38736ed114a38482bf4
parent79de2d31f1ff8910231b7ec15519405953e6571a
IOMMU: generalize and correct softirq processing during Dom0 device setup

c/s 21039:95f5a4ce8f24 ("VT-d: reduce default verbosity") having put a
call to process_pending_softirqs() in VT-d's domain_context_mapping()
was wrong in two ways: For one we shouldn't be doing this when setting
up a device during DomU assignment. And then - I didn't check whether
that was the case already back then - we shouldn't call that function
with the pcidevs_lock (or in fact any spin lock) held.

Move the "preemption" into generic code, at once dealing with further
actual (too much output elsewhere - particularly on systems with very
many host bridge like devices - having been observed to still cause the
watchdog to trigger when enabled) and potential (other IOMMU code may
also end up being too verbose) issues.

Do the "preemption" once per device actually being set up when in
verbose mode, and once per bus otherwise.

Note that dropping pcidevs_lock around the process_pending_softirqs()
invocation is specifically not a problem here: We're in an __init
function and aren't racing with potential additions/removals of PCI
devices. Not acquiring the lock in setup_dom0_pci_devices() otoh is not
an option, as there are too many places that assert the lock being
held.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Xiantao Zhang <xiantao.zhang@intel.com>
xen/drivers/passthrough/pci.c
xen/drivers/passthrough/vtd/iommu.c